package com.health.db.dao.sm.impl;

import java.util.List;

import com.health.db.dao.ServiceInterface;
import com.health.db.dao.sm.IDepartmentListDao;
import com.health.db.mapper.DepartmentListMapper;
import com.health.db.model.DepartmentListTemp;
import com.health.redis.RedisConstants;

public class  DepartmentListDaoImpl  extends ServiceInterface implements IDepartmentListDao
{
	
	DepartmentListMapper departmentListMapper;

	/**
	 * 无参数
	 * @methodOrder s1
	 */
	@Override
	public List<DepartmentListTemp> selectSimpleForInit() {
		// TODO Auto-generated method stub
		
		String key=RedisConstants.DepartmentListMapper;
		List<DepartmentListTemp> list=null;
		Object object=null;
		
		if(redisOperatiorLogic.isJedisIsConnected())
		{
			object = redisOperatiorLogic.readObject(key, getOrderRedisGroupNo("1"));
		}
		if(null!=object){
			
			if (!object.equals("")) {
				list =  (List) object;
			}
		}
		else
		{
			list=departmentListMapper.selectSimpleForInit();
			if(redisOperatiorLogic.isJedisIsConnected())
			{
			redisOperatiorLogic.setEx(key, list, getOrderRedisGroupNo("1"));
			}
		}

		return list;
	}

	/**
	 * @return the departmentListMapper
	 */
	public DepartmentListMapper getDepartmentListMapper() {
		return departmentListMapper;
	}

	/**
	 * @param departmentListMapper the departmentListMapper to set
	 */
	public void setDepartmentListMapper(DepartmentListMapper departmentListMapper) {
		this.departmentListMapper = departmentListMapper;
	}
}
